<?php /* Smarty version Smarty-3.0.8, created on 2014-11-03 19:12:43
         compiled from "tpl/js/controller/main-nav.js" */ ?>
<?php /*%%SmartyHeaderCode:285905457632b494e22-44576523%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '985b127fbca8d3bcd81d3695d3859155d0089cf6' => 
    array (
      0 => 'tpl/js/controller/main-nav.js',
      1 => 1410831322,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '285905457632b494e22-44576523',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>

      //主导航
      App.controller('main-nav', function (page) {
        this.transition = 'slide-right';
 
        $(page).on("appReady",function(){

            $("#username").text(kget("username"));
            $("#studentid").text(kget("studentid"));
            $.post(url("team","team_list"),{name:kget("username")},function(data){
              //创建的团队
              for(var i=0;i<data['own'].length;i++){
                var li_team = $("<li>").addClass("app-button").data("contact",data['own'][i]).html(data['own'][i].team_name);                
                li_team.on("tap",function(){
                  var contact=$(this).data("contact");
                  App.load("team-time-nav",contact);
                });
                var span_team = $("<span>").addClass("app-button app-sub-button").html("管理");
                li_team.append(span_team);
                $(page).find("#team").append(li_team);
              }
              //参加的团队
              for(var i=0;i<data['join'].length;i++){
                var li_team = $("<li>").addClass("app-button").data("contact",data['join'][i]).html(data['join'][i].team_name);                
                li_team.on("tap",function(){
                  var contact=$(this).data("contact");
                  App.load("team-time-nav",contact);
                });
                var span_team = $("<span>").addClass("app-button app-sub-button").html("查看");
                li_team.append(span_team);
                $(page).find("#team").append(li_team);
              }              
            },"json");

        });
      });